<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/11/011
 * Time: 16:08
 */

namespace app\Lib\Model\AdminAuth;


use app\Lib\Model\DbModel\AdminMenu;

class GetTopMenu
{
    public function run(){
        $model  =  new AdminMenu();
        $result = $model->where([$model->_parent_id=>0])->column($model->_id);
        $list = [];
        if(!empty($result)){
            foreach ($result as $v){
                $menuAuth = new MenuAuth($v);
                $list[$menuAuth->getMark()] =$menuAuth->getName();
            }
        }
        return $list;
    }
}